﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using CoreLibrary.Service;
using Entities;
using Entities.DataBase.Obj;
using Entities.DataBase.Persistent;
using WebService.Service.Transfer;

namespace WebService.Service {

    [ServiceContract]
    public interface ISettingServiceX {

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
            RequestFormat  = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "/GetSettings")]
        List<Setting> GetSettings(string passport);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "/UpdateSetting")]
        bool UpdateSetting(string passport, SettingKey key, string value);

        [OperationContract]
        [FaultContract(typeof(ServiceError))]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "/UpdateSettings")]
        bool UpdateSettings(string passport, UpdateSettingsRequest request);

    }
}
